home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-portable.exe / quodlibet-3.3.0-portable / data / bin / dummy_threading.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  1KB  |  51 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. '''Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
  5.  
  6. The module ``_dummy_threading`` is added to ``sys.modules`` in order
  7. to not have ``threading`` considered imported.  Had ``threading`` been
  8. directly imported it would have made all subsequent imports succeed
  9. regardless of whether ``thread`` was available which is not desired.
  10.  
  11. '''
  12. from sys import modules as sys_modules
  13. import dummy_thread
  14. holding_thread = False
  15. holding_threading = False
  16. holding__threading_local = False
  17.  
  18. try:
  19.     if 'thread' in sys_modules:
  20.         held_thread = sys_modules['thread']
  21.         holding_thread = True
  22.     sys_modules['thread'] = sys_modules['dummy_thread']
  23.     if 'threading' in sys_modules:
  24.         held_threading = sys_modules['threading']
  25.         holding_threading = True
  26.         del sys_modules['threading']
  27.     if '_threading_local' in sys_modules:
  28.         held__threading_local = sys_modules['_threading_local']
  29.         holding__threading_local = True
  30.         del sys_modules['_threading_local']
  31.     import threading
  32.     sys_modules['_dummy_threading'] = sys_modules['threading']
  33.     del sys_modules['threading']
  34.     sys_modules['_dummy__threading_local'] = sys_modules['_threading_local']
  35.     del sys_modules['_threading_local']
  36.     from _dummy_threading import *
  37.     from _dummy_threading import __all__
  38. finally:
  39.     if holding_threading:
  40.         sys_modules['threading'] = held_threading
  41.         del held_threading
  42.     del holding_threading
  43.     if holding__threading_local:
  44.         sys_modules['_threading_local'] = held__threading_local
  45.         del held__threading_local
  46.     del holding__threading_local
  47.     del holding_thread
  48.     del dummy_thread
  49.     del sys_modules
  50.  
  51.